home *** CD-ROM | disk | FTP | other *** search
- #include <string.h>
-
- /************************************************************************/
-
- #if defined(__GNUC__) && defined(mc68000)
-
- asm("
- .globl _strchr
- _strchr:
- movel sp@(4:W),a0
- movel sp@(8:W),d0
- L2: cmpb a0@,d0
- jeq L1
- tstb a0@+
- jne L2
- subal a0,a0
- L1: movel a0,d0
- rts
- ");
-
- #else
-
- char *strchr(const char *String, int c)
-
- {
- while (*String!=(char)c)
- {
- if (!(*String++))
- {
- String=NULL;
- break;
- }
- }
- return (char *)String;
- }
-
- #endif
-